home *** CD-ROM | disk | FTP | other *** search
- Path: service-2.agate.net!usenet
- From: ettienne@agate.net (Steve Nutt)
- Newsgroups: comp.lang.c++
- Subject: Re: THE STRUCT of C++
- Date: Sat, 20 Apr 1996 05:07:12 GMT
- Organization: DET
- Message-ID: <4l9k0m$mbo@service-2.agate.net>
- References: <Pine.SUN.3.90.960410214925.10294B-100000@rose.cs.odu.edu>
- Reply-To: ettienne@agate.net
- NNTP-Posting-Host: ettienne.sdi.agate.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- "CLEVELAND O. BURNETT" <cob@cs.odu.edu> wrote:
-
-
-
- >To all who may read this?
-
-
-
- >I have a textfile that I am trying to read as a C++ struct!!!!!
-
- >How can I do this?
-
-
- >The STRUCT of C++
-
-
-
- >struct students {
- >char firstname[20];
- >char middle_initial;
- >char lastname[20];
- >char address1[40];
- >char address2[30];
- >char phone_number[7];
- >char email[50];};
-
-
- >PLEASE HELP ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-
- > Cleveland.................
-
- You could write a << operator for it and stream the text file into the
- struct. If you are using Borland you may be able to use some of their
- base streaming classes. If not you compiler vendor may provide some.
-
- I must confess to having not done much with streaming, but even
- without the base classes it does not look like a hard problem.
-
- Steve
-
-